<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="models.BeanUser" %>
   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<title>Exemple Formulari </title>
		<link rel="stylesheet" type="text/css" href="css/main.css" />
		<script type="text/javascript" src="js/jquery-1.7.1.js"></script>
		<script type="text/javascript" src="js/jquery.validate.js"></script>
		
		<script>
		$(document).ready(function(){
		    $("#registerForm").validate({
		    	submitHandler: function(form) {
		    		$('#rightcolumn').load('logincontroller',$("#registerForm").serialize());
		    	}
		    });
		});
		</script>
	</head>
	<body>
		<% 
			BeanUser user = null;
			if (request.getAttribute("user")!=null) {
				user = (BeanUser)request.getAttribute("user");
			} else {
				user = new BeanUser();
			}
		%>
		<center>
			<form id="registerForm" class="login" action="" method="POST">
				<table>
					<tr>
						<td class="registro">Alias:</td>
						<td><input type="text" id="alias" name="alias" maxlength="25" size="25" value="<%=user.getAlias() %>" class="required"/></td>
						<% if ( user.getError()[0] == 1) { %> 
							<td class="error"> El alias o el Password son incorrectos</td>  
						<% } %>
					</tr>
					<tr>
						<td class="registro">Password:</td>
						<td><input type="password" id="pass" name="pass" value="<%=user.getPass() %>" maxlength="25" size="25" minlength="6" class="required"/></td>
					</tr>
					<tr> 
						<td> <input name="sumbit" type="submit" value="Enviar"> </td>
					</tr>
				</table>
			</form>
		</center>
	</body>
</html>